package com.shop.Control;

import java.io.InputStream;
import java.io.StringBufferInputStream;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.shop.service.GoodsServiceImpl;
import com.shop.service.MerchantServiceImpl;
import com.shop.util.BeanUtil;

/**
 * 
 * <b>商品详情页<b>
 * @author 威 
 * <br>2017年12月
 *
 */
public class GoodsPageAction  extends SuperActionSupport {
	private static final long serialVersionUID = 7539369474585568995L;
	
	public GoodsServiceImpl getService(){
		return (GoodsServiceImpl) BeanUtil.getBean("goodsServiceImpl") ;
	}
	
	public String execute(){
		/*
		这里的测试数据是1
		 * */
		ActionContext context = ActionContext.getContext() ;
		Integer id = (Integer) context.getSession().get("goods_id") ;
		System.out.println("初始化商品页") ;
		if(id != null)
			print(getService().initPage(id)) ;
		else print("false") ;
		return SUCCESS ;
	}

}
